export namespace PathUtil {
  export function getName(fullName: string) {
    return fullName.substring(fullName.lastIndexOf("/") + 1);
  }

  /**
   * 排除从顶层开始的第几层名字
   * @param index
   */
  export function excludeTopFolder(fullName: string, index: number = 1) {
    return fullName.substring(fullName.indexOf("/") + 1);
  }

  /**
   * 返回ext
   */
  export function getExtName(fileName: string): string | undefined {
    let index = fileName.indexOf(".");
    return index == -1 ? undefined : fileName.substring(index + 1);
  }
}